/*
 * ECU_TJA1145.h
 *
 *  Created on: 2018年12月3日
 *      Author: 40786
 */

#ifndef ECU_TJA1145_H_
#define ECU_TJA1145_H_


                                               /*     7      6      5      4      3      2      1      0      */
#define Mode_Control               0x01        /*R/W |  reserv                        |       MC          |   */
                                               /*   MC  001:sleep mode  100:Standby mode 111:Normal mode      */
#define Main_Status                0x03        /* R |FSMS |  OTWS |  NMS | reserve                        |   */
#define System_Event_Enable        0x04        /* 2:0   MC  001:sleep mode  100:Standby mode 111:Normal mode  */
#define Memory0                    0x06        /* 2:0   MC  001:sleep mode  100:Standby mode 111:Normal mode  */
#define Memory1                    0x07        /* 2:0   MC  001:sleep mode  100:Standby mode 111:Normal mode  */
#define Memory2                    0x08        /* 2:0   MC  001:sleep mode  100:Standby mode 111:Normal mode  */
#define Memory3                    0x09        /* 2:0   MC  001:sleep mode  100:Standby mode 111:Normal mode  */
#define Lock_Control               0x0A        /* 2:0   MC  001:sleep mode  100:Standby mode 111:Normal mode  */
#define CAN_Control                0x20        /* 2:0   MC  001:sleep mode  100:Standby mode 111:Normal mode  */
#define Transceiver_Status         0x22        /* 2:0   MC  001:sleep mode  100:Standby mode 111:Normal mode  */
#define Transceiver_Event_Enable   0x23        /* 2:0   MC  001:sleep mode  100:Standby mode 111:Normal mode  */
#define Data_Rate                  0x26        /* 2:0   MC  001:sleep mode  100:Standby mode 111:Normal mode  */
#define Identifier0                0x27        /* 2:0   MC  001:sleep mode  100:Standby mode 111:Normal mode  */
#define Identifier1                0x28        /* 2:0   MC  001:sleep mode  100:Standby mode 111:Normal mode  */
#define Identifier2                0x29        /* 2:0   MC  001:sleep mode  100:Standby mode 111:Normal mode  */
#define Identifier3                0x2A        /* 2:0   MC  001:sleep mode  100:Standby mode 111:Normal mode  */
#define Mask0                      0x2B        /* 2:0   MC  001:sleep mode  100:Standby mode 111:Normal mode  */
#define Mask1                      0x2C        /* 2:0   MC  001:sleep mode  100:Standby mode 111:Normal mode  */
#define Mask2                      0x2D        /* 2:0   MC  001:sleep mode  100:Standby mode 111:Normal mode  */
#define Mask3                      0x2E        /* 2:0   MC  001:sleep mode  100:Standby mode 111:Normal mode  */
#define Frame_Control              0x2F        /* 2:0   MC  001:sleep mode  100:Standby mode 111:Normal mode  */
#define Data_Mask0                 0x68        /* 2:0   MC  001:sleep mode  100:Standby mode 111:Normal mode  */
#define Data_Mask1                 0x69        /* 2:0   MC  001:sleep mode  100:Standby mode 111:Normal mode  */
#define Data_Mask2                 0x6A        /* 2:0   MC  001:sleep mode  100:Standby mode 111:Normal mode  */
#define Data_Mask3                 0x6B        /* 2:0   MC  001:sleep mode  100:Standby mode 111:Normal mode  */
#define Data_Mask4                 0x6C        /* 2:0   MC  001:sleep mode  100:Standby mode 111:Normal mode  */
#define Data_Mask5                 0x6D        /* 2:0   MC  001:sleep mode  100:Standby mode 111:Normal mode  */
#define Data_Mask6                 0x6E        /* 2:0   MC  001:sleep mode  100:Standby mode 111:Normal mode  */
#define Data_Mask7                 0x6F        /* 2:0   MC  001:sleep mode  100:Standby mode 111:Normal mode  */
#define WAKE_Pin_Status            0x4B        /* 2:0   MC  001:sleep mode  100:Standby mode 111:Normal mode  */
#define WAKE_Pin_Enable            0x4C        /* 2:0   MC  001:sleep mode  100:Standby mode 111:Normal mode  */
#define Event_Capture_Status       0x60        /* 2:0   MC  001:sleep mode  100:Standby mode 111:Normal mode  */
#define System_Event_Status        0x61        /* 2:0   MC  001:sleep mode  100:Standby mode 111:Normal mode  */
#define Transceiver_Event_Status   0x63        /* 2:0   MC  001:sleep mode  100:Standby mode 111:Normal mode  */
#define WAKE_Pin_Event_Status      0x64        /* 2:0   MC  001:sleep mode  100:Standby mode 111:Normal mode  */
#define Identification             0x7E        /* 2:0   MC  001:sleep mode  100:Standby mode 111:Normal mode  */




void TJA1145_GO_Sleep(void);
void ECU_1145_PORT_INIT(void);
void TJA1145_Init_mode(void);
u16 TJA1145_SPI2_Write(uint8 Addr,uint8 data);
u16 TJA1145_SPI2_Read(uint8 Addr);










#endif /* ECU_TJA1145_H_ */
